<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<table border="1">
    <caption>个人信息</caption>
    <tr>
        <td>照片:</td>
        <td id="head_td"></td>
    </tr>
    <tr>
        <td>名字:</td>
        <td id="name_td"></td>
    </tr>
    <tr>
        <td>年龄:</td>
        <td id="age_td"></td>
    </tr>
    <tr>
        <td>好友</td>
        <td id="friend_td"></td>
    </tr>
</table>
<input type="button" value="请求数据" onclick="f()">

<script>
    function f(){
        let arr={
           url:"3.jpg",
            name:"张三",
            age:18,
            friends:["z","s"]
        }
        let img=document.createElement("img");
        let tr=document.createElement("tr");
        let td1=document.querySelector("#head_td");
        let td2=document.querySelector("#name_td");
        let td3=document.querySelector("#age_td");
        let td4=document.querySelector("#friend_td");
        img.src=arr.url;

        td1.append(img);
        td2.innerText=arr.name;
        td3.innerText=arr.age;

        let ul=document.createElement("ul");
        let li=document.createElement("li");
        for (let a of arr.friends) {
            let li=document.createElement("li");
            li.innerText=a;
            ul.append(li);
        }
        td4.append(ul);

    }
</script>
</body>
</html>